//
//  common.h
//  template4
//
//  Created by Xiaochen Lian on 5/14/12.
//  Copyright (c) 2012 University of California, Los Angeles. All rights reserved.
//

#ifndef template4_common_h
#define template4_common_h

#include "Angel/Angel.h"
#include "Shapes.h"

typedef Angel::vec4 color4;
typedef Angel::vec4 point4;
typedef Angel::vec3 point3;
typedef Angel::vec2 point2;

struct lighting_struct
{
    color4 ambient, diffuse, specular;
    GLfloat shininess;
};

// Structs that hold the Vertex Array Object index and number of vertices of each shape.
extern ShapeData cubeData;
extern ShapeData sphereData;
extern ShapeData ellipsData;
extern ShapeData coneData;
extern ShapeData cylData;

extern mat4         model_view;
extern GLint        uModelView, uProjection, uCameraView;
extern GLint        uAmbient, uDiffuse, uSpecular, uLightPos, uShininess;
extern GLint        uTex, uEnableTex;
extern lighting_struct g_env_lighting;

/////////////////////////////////////////////////////
//    PROC: drawCylinder()
//    DOES: this function 
//          render a solid cylinder  oriented along the Z axis. Both bases are of radius 1. 
//          The bases of the cylinder are placed at Z = 0, and at Z = 1.
//
//          
// Don't change.
//////////////////////////////////////////////////////
void drawCylinder(mat4 model_view);

//////////////////////////////////////////////////////
//    PROC: drawCone()
//    DOES: this function 
//          render a solid cone oriented along the Z axis with base radius 1. 
//          The base of the cone is placed at Z = 0, and the top at Z = 1. 
//         
// Don't change.
//////////////////////////////////////////////////////
void drawCone(mat4 model_view);

//////////////////////////////////////////////////////
//    PROC: drawCube()
//    DOES: this function draws a cube with dimensions 1,1,1
//          centered around the origin.
// 
// Don't change.
//////////////////////////////////////////////////////
void drawCube(mat4 model_view);

//////////////////////////////////////////////////////
//    PROC: drawSphere()
//    DOES: this function draws a sphere with radius 1
//          centered around the origin.
// 
// Don't change.
//////////////////////////////////////////////////////
void drawSphere(mat4 model_view);

void drawEllips(mat4 model_view);

//----------------------------------------------------------------------------
//
//  Translation Rotation matrix generators
//
mat4 TRTX( const GLfloat theta, const vec3 v );
mat4 TRTY( const GLfloat theta, const vec3 v );
mat4 TRTZ( const GLfloat theta, const vec3 v );
#endif
